-- =============================================
-- Create View_TKNHANVIEN
-- =============================================
USE DAILY
GO

IF object_id(N'dbo.View_TKNHANVIEN', 'V') IS NOT NULL
	DROP VIEW dbo.View_TKNHANVIEN
GO

CREATE VIEW dbo.View_TKNHANVIEN AS
SELECT MaTaiKhoan, TenDangNhap, MatKhau, MaNhanVien, TrangThai
	FROM dbo.TKDANGNHAP
	WHERE MaNhanVien IS NOT NULL
GO

-- =============================================
-- Create View_TKADMIN
-- =============================================
USE DAILY
GO

IF object_id(N'dbo.View_TKADMIN', 'V') IS NOT NULL
	DROP VIEW dbo.View_TKADMIN
GO

CREATE VIEW dbo.View_TKADMIN AS
SELECT MaTaiKhoan, TenDangNhap, MatKhau, TrangThai
	FROM dbo.TKDANGNHAP
	WHERE MaNhanVien IS NULL
GO